

<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'role.label', default: 'Role')}" />
  <title><g:message code="default.edit.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
	<span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
	<span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">
	<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
	<g:if test="${flash.message}">
	  <div class="message">${flash.message}</div>
	</g:if>
	<g:hasErrors bean="${role}">
	  <div class="errors">
		<g:renderErrors bean="${role}" as="list" />
	  </div>
	</g:hasErrors>
	<g:form method="post" >
	  <g:hiddenField name="id" value="${role?.id}" />
	  <g:hiddenField name="version" value="${role?.version}" />
	  <div class="dialog">
		<table>
		  <tbody>

			<tr class="prop">
			  <td valign="top" class="name">
				<label for="roleName"><g:message code="role.roleName.label" default="Role Name" /></label>
			  </td>
			  <td valign="top" class="value ${hasErrors(bean: role, field: 'roleName', 'errors')}">
		  <g:textField name="roleName" maxlength="16" value="${role?.roleName}" />
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="description"><g:message code="role.description.label" default="Description" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: role, field: 'description', 'errors')}">
		  <g:textArea name="description" cols="40" rows="5" value="${role?.description}" />
		  </td>
		  </tr>

		  <tr class="prop">
			<td valign="top" class="name">
			  <label for="privileges"><g:message code="role.privileges.label" default="Privileges" /></label>
			</td>
			<td valign="top" class="value ${hasErrors(bean: role, field: 'privileges', 'errors')}">
		  <g:each in="${Privilege.list()}" var="p">
			<g:checkBox name="selectedPrivileges" value="${p.id}" checked="${role.privileges.contains(p)}"/>${p.privName}<BR/>
		  </g:each>
		  </td>
		  </tr>

		  </tbody>
		</table>
	  </div>
	  <div class="buttons">
		<span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
		<span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
	  </div>
	</g:form>
  </div>
</body>
</html>
